package cn.zclong.reply.service;

import cn.zclong.article.domain.Article;
import cn.zclong.article.domain.PageBean;
import cn.zclong.reply.dao.ReplyDao;
import cn.zclong.reply.domain.Reply;

public class ReplyService {
	private ReplyDao replyDao = new ReplyDao();
	
	/*
	 * 查找所有的评论
	 */
	public PageBean<Reply> findAll(int pc, int ps, String id) {
		return replyDao.findAll(pc, ps, id);
	}

	/*
	 * 发表评论，插入
	 */
	public void addReply(String aid, String userId, String message, String ip) {
		replyDao.addReply(aid, userId, message, ip);
	}

	public PageBean<Article> adminFindById(int pc, int ps) {
		
		return replyDao.adminFindById(pc, ps);
	}

	
	/*
	 * 根据帖子id查找对应的评论
	 */
	public PageBean<Reply> adminFindReplyById(int pc, int ps, String id) {
		return replyDao.adminFindReplyById(pc, ps, id);
	}

	public void adminUpdateById(String userId, String rid) {
		replyDao.adminUpdateById(userId, rid);
		
	}

	public void adminDeleteById(String rid) {
		replyDao.adminDeleteById(rid);
		
	}

	public void adminDeleteAll(String aid) {
		replyDao.adminDeleteAll(aid);
	}
}
